#ifndef PLMS_H
#define PLMS_H

#include <stdlib.h>
#include <string.h>
#include <stdbool.h>

// #include "charge.h"
#define IDMAXSIZE 10
#define DATETIME 6
// Choose the item
enum ITEM_NAME
    {
        PARK_CAR = 1,//default will be zero
        DRIVE_AWAY,
        VIEW_CAR,
        PRINT_TABLE,
        EXIT
     };
enum PARK_PLACE
    {
        PARKINGLOT,
        SIDEWALK
    };

typedef struct _CarNode
  {
    char ID[IDMAXSIZE];
    char ArriveTime[DATETIME];
    //hh:mm:ss
    char DriveAwayTime[DATETIME];
    int ParkPlace, Serial;
    //hh:mm:ss
    struct _CarNode *next;
    // for queue
  }Car;
typedef struct//Stack
  {
      Car **PtrArr;
      int StackSize;
      int top;
  }Stack;
typedef struct//Queue
  {
      int len;
      int QueueSize;
      Car *FirstNode;
      Car *LastNode;
  }Queue;

void PLMS();

// Init System
Stack *InitStack(int StackSize);
Queue *InitQueue(int QueueSize);
// Create new (car*) queue node
Car *CreateNewQNode();
// Register One Car
Car *RegisterOneCar();
// Check Is Full
bool IsStackFull(Stack *ParkLotStack);
bool IsQueueFull(Queue *CarQueue);
// Search Car
void ViewCar(Stack *ParkLotStack, Queue *CarQueue);
Car *SearchCar(Stack *ParkLotStack, Queue *CarQueue);
Car *SearchInStack(Stack *ParkLotStack, char *TargetCarID);
Car *SearchInQueue(Queue *CarQueue, char *TargetCarID);
// Operate Car
void ParkNewCar(Stack *ParkLotStack, Queue *CarQueue);
void DriveAway(Stack *ParkLotStack, Queue *CarQueue);
void RemoveFromStack(Stack *ParkLotStack, Car *TargetCar);
void RemoveFromQueue(Queue *CarQueue, Car *Target);
// Operate Car In Stack
void MoveCarInStack(Stack *ParkLotStack, int TargetCarSerial);
void PutCarInStack(Stack *ParkLotStack);
void PushCar(Stack *ParkLotStack, Car *ThisCar);
// Operate Car In Queue

bool AddCar(Queue *CarQueue, Car *NewCar);
bool AddCarInQueue(Queue *CarQueue);

#endif

#include "output.h"
#include "charge.h"
